<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>大耳狐 - 我要开店</title>
<link href="__PUBLIC__/css/client_common.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/css/user.css" rel="stylesheet" type="text/css" />

<script src="__PUBLIC__/js/jquery-1.7.2.js" type="text/javascript"></script>
<style type="text/css">
.table{background-color:#B0C4DE;width:100%;}
.table tr{background-color:#fff;}
.table th{width:130px;font-weight:normal;text-align:right;height:30px;font-size:12px;padding:5px;}
.table td{padding:5px;font-size:12px;}
.table .separate{text-align:center;}
</style>

</head>
<body>
{:R('Public/Head','','Widget')}

<div id="content">
	 {:R('Public/MainHead','','Widget')}
	 
	 <div class="contentBox">
		<div id="leftMenu" class="leftPart6">
			{:R('Public/shopMenu','','Widget')}
		</div>
		
		<div class="rightPart6">
			<form id="shopForm" method="post" action="__APP__/Shop/doOpenShop">
			<table cellspacing="1" class="table">
				<tr>
					<th>商铺类型：</th>
					<td>
						<select name="type" id="shopType">
							<option value="0">--请选择--</option>	
							<volist name="shopList" id="list">
							<option value="{$key}">{$list}</option>	
							</volist>
						</select>
					</td>
				</tr>
				<tr>
					<th>消费积分：</th>
					<td><span id="cost">0</span>积分<span id="enough"></span></td>			
				</tr>
				<tr>
					<th>店铺名称：</th>
					<td><input type="text" name="name" /></td>			
				</tr>
				<tr>
					<th>经营品牌：</th>
					<td><input type="text" name="brands" /></td>			
				</tr>
				<tr id="brandList" style="display:none;">
					<th>主营品牌：</th>
					<td>
						<select name="brand_id">
							<volist name="brandList" id="vo">
							<option value="{$vo.id}">{$vo.name}</option>
							</volist>
						</select>
					</td>			
				</tr>
				<tr>
					<th>省份：</th>
					<td>
						<select id="province" name="province">
						<option value="">--请选择--</option>
						<volist name="province" id="vo">
							<option value="{$key}">{$vo}</option>
						</volist>	
						</select>
					</td>			
				</tr>
				<tr>
					<th>城市：</th>
					<td>
						<select id="cityList" name="city">
							<option>--请选择--</option>
						</select>
					</td>			
				</tr>
				<tr>
					<th>详细地址：</th>
					<td><input type="text" name="address" /></td>			
				</tr>
				<tr>
					<th>联系电话：</th>
					<td><input type="text" name="tel" /></td>			
				</tr>
				<tr>
					<th>email：</th>
					<td><input type="text" name="email" /></td>			
				</tr>
				<tr>
					<td colspan="2" class="separate">--------以下选填--------</td>
				</tr>
				<tr>
					<th>400电话：</th>
					<td><input type="text" name="server_tel" /></td>			
				</tr>
				<tr>
					<th>传真号码：</th>
					<td><input type="text" name="fax" /></td>			
				</tr>
				<tr>
					<th>QQ号码：</th>
					<td><input type="text" name="qq" /></td>			
				</tr>
				<tr>
					<th>店铺简介：</th>
					<td><textarea name="introduce" rows="3" cols="50"></textarea></td>			
				</tr>
				<tr>
					<th>地图信息：</th>
					<td></td>			
				</tr>
				<tr>
					<th></th>
					<td>
						<input type="submit" value="点击开设" />
					</td>			
				</tr>
			</table>
			</form>
		</div>
		
		<div class="clear_both"></div>
	</div>
</div>


<script type="text/javascript">
$("#province option").click(function(){
	var province = $(this).val().trim();
	if (province != "" && province != null) {
		$.get(
				"__APP__/Shop/getCitys",
				{p_code:province},
				function(result){
					//var data = $.parseJSON(result);
					$("#cityList").html(result);
				}
			);
	}
});

$("#shopType option").click(function(){
	var type = $(this).val().trim();
	if (type)
		getPrice(type);
	
	if (type == 10001)
		$("#brandList").show();
	else
		$("#brandList").hide();
		
});

function getPrice(type) {
	$.get(
		"__APP__/Shop/ajaxGetShopPrice",
		{type:type},
		function(result){
			var data = $.parseJSON(result);
			$("#cost").html(data.cost);
			if (data.enough != 1)
				$("#enough").html('(<span style="color:red;">积分不足！</span>)');
		}
	);
}

</script>

{:R('Public/Footer','','Widget')}